package com.errol.batchprocessor.employeeaddition.advisorimpl.common.payload;

import com.renjia.pojo.MyBankCardValidator;
import com.renjia.pojo.MyIdNumValidator;
import com.renjia.pojo.MyMobileValidator;
import com.renjia.service.generic.middleware.batchprocessor.payload.AbstractPiecePayload;
import com.renjia.service.generic.middleware.batchprocessor.payload.AbstractSinglePayload;
import lombok.Getter;

import java.util.List;

/**
 * 人员导入批处理业务 分片数据抽象类
 *
 * @author zhang xiao bin
 * @version v1.0
 * @date 2021/02/22
 * @since v5.0.5
 **/
@Getter
public abstract class AbstractEmployeePiecePayload<SE, SP extends AbstractSinglePayload<SE>> extends AbstractPiecePayload<SE, SP> {

    private MyIdNumValidator myIdNumValidator;
    private MyMobileValidator myMobileValidator;
    private MyBankCardValidator myBankCardValidator;
    private EmployeeAdditionCountPayload countPayload;

    public AbstractEmployeePiecePayload(List<SP> singlePayloadList) {
        super(singlePayloadList);
        countPayload = null;
    }

    public void prepareValidator() {
        myIdNumValidator = new MyIdNumValidator();
        myMobileValidator = new MyMobileValidator();
        myBankCardValidator = new MyBankCardValidator();
    }

    public void initCountPayload() {
        countPayload = new EmployeeAdditionCountPayload();
    }
}
